Skip to content

feat: normalize semantic version strings for speech#39

Merged
StuBehan merged 1 commit into
mainfrom
feat/semver-normalization
Jul 10, 2026
Merged

feat: normalize semantic version strings for speech#39
StuBehan merged 1 commit into
mainfrom
feat/semver-normalization

Conversation

@StuBehan

@StuBehan StuBehan commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

decimals_to_words only splits the first decimal point, so a dotted version like 0.7.0 came out as "0 point 7.0" — it expanded the first dot and left a stray full stop mid-number. This adds a versions pass so multi-part version strings read naturally.

Changes

  • versions_to_words runs just before the decimal split: every . in a 3-or-more-part number becomes "point" (0.7.0 → "0 point 7 point 0", 1.20.3 → "1 point 20 point 3").
  • Two-part numbers are left alone so ordinary decimals still read digit-by-digit (3.14 → "3 point 1 4"), and a trailing sentence stop is preserved (upgrade to 1.2.3.).

Testing

  • pytest — adds unit tests for spelling out versions, leaving decimals and trailing stops intact, plus an end-to-end normalize_for_speech check; ruff check . clean.
  • End-to-end: stackvox normalize "Upgraded to 0.7.0 today. Pi is 3.14."Upgraded to 0 point 7 point 0 today. Pi is 3 point 1 4.

Related issues

None.

@StuBehan StuBehan force-pushed the feat/semver-normalization branch from 767d535 to 25be215 Compare July 10, 2026 14:52
@StuBehan StuBehan force-pushed the feat/semver-normalization branch from 25be215 to 5be9a44 Compare July 10, 2026 14:57
@StuBehan StuBehan merged commit 1336087 into main Jul 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant